<?php

class OrderAction extends BaseAction {

    public function index() {
        import("ORG.Util.Page"); //引入分页类
        $product_quote_model = M('mer_product_quote');

        $where['mer_product_quote.mer_userid'] = array('eq', $this->user_info['userid']);
        $count = $product_quote_model->where($where)->count(); // 查询满足要求的总记录数
        $page = new Page($count, 100); // 实例化分页类
        $order_data = $product_quote_model->field("mer_product_quote.*,mer_product.title")->where($where)
                        ->join('mer_product on mer_product_quote.mer_productid = mer_product.id')
                        ->order("mer_product_quote.id desc")->limit($page->firstRow . "," . $page->listRows)->select();
						//dump($product_quote_model->getLastSql());
        $page_show = $page->show();

        $this->assign('orderdata', $order_data);
        $this->assign('page', $page_show);
        $this->display();
    }

}

?>
